package com.zengguang.testkaoshi.services.impl;

import com.zengguang.testkaoshi.dao.AuthDao;
import com.zengguang.testkaoshi.pojo.Auth;
import com.zengguang.testkaoshi.services.IAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AuthService implements IAuthService {
    @Autowired
    private AuthDao authDao;
    @Override
    public List<Auth> selectAllAuth() {
        List<Auth> list=authDao.selectAllAuth();
        return list;
    }

    @Override
    public int insertAuth(Auth auth) {
        int returnInt=0;
        int addAuthInt=authDao.insertAuth(auth);
        returnInt=addAuthInt;
        return returnInt;
    }

    @Override
    public int deleteAuth(int authid) {
        int returnInt=0;
        int addAuthInt=authDao.deleteAuth(authid);
        returnInt=addAuthInt;
        return returnInt;
    }

    @Override
    public int updateAuth(Auth auth) {
        int returnInt=0;
        int addAnswerInt=authDao.updateAuth(auth);
        returnInt=addAnswerInt;
        return returnInt;
    }
}
